<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript">
function selectstudent1(form){
		var studentid=form.studentid.value;
		var page=form.page.value;
		var bjid=form.bjid.value;
		var msg = "确定要退出?\n\n请选择!";
		if (confirm(msg)==true){
		 		$('#b1').load('${pageContext.request.contextPath}/admin/studentdelete?page='+page+'&bjid='+bjid+'&studentid='+studentid); 
		 		return false;
		 	}else{ 
		 		return false;
		 	}
	};
	function password1(form){
 		var page=form.page.value;
		var bjid=form.bjid.value;
 		var studentid=form.studentid.value;
 		var msg="确定要重置 "+name+" 的密码？\n\n请选择";
 		if (confirm(msg)==true){
 		 		$('#b1').load('${pageContext.request.contextPath}/admin/studentpassword?page='+page+'&bjid='+bjid+'&studentid='+studentid);
 		 		return false;
 		 	}else{ 
 		 		return false; 
 		 	}
 	}; 
 	function xiugai(form){
 		var page=form.page.value;
		var bjid=form.bjid.value;
 		var id=form.id.value;
 		var msg="确定要修改 "+name+"用户的信息？\n\n请选择";
 		if (confirm(msg)==true){
		 		$('#b1').load('${pageContext.request.contextPath}/admin/xiugai?page='+page+'&bjid='+bjid+'&id='+id);
		 		$('#b1').dialog();
		 		return false;
		 	}else{ 
		 		return false; 
		 	}
 	};
 	function xinzeng(form){
 		var page=form.page.value;
		var bjid=form.bjid.value;
 		var msg="确定要新增 "+name+"用户的信息？\n\n请选择";
 		if (confirm(msg)==true){
		 		$('#b1').load('${pageContext.request.contextPath}/admin/xiugai?page='+page+'&bjid='+bjid);
		 		$('#b1').dialog();
		 		return false;
		 	}else{ 
		 		return false;  
		 	}
 	};
</script>
<!DOCTYPE html>

							<div class="table-responsive">
								<form onclick='return xinzeng(this);' class="form_form">
                                            		<input type="hidden" name="page" value="${pageq }">
                                            		<input type="hidden" name="bjid" value="${bjidq }">
                                            		<button type="button"  class="btn btn-info">新增</button>
                                 </form>
								<c:if test="${sound!=null }">
									<div class="alert alert-success">
										<a href="#" class="close" data-dismiss="alert"> &times; </a> <strong
											style="margin-left: 200px;">成功!</strong> ${sound }
									</div>
								</c:if>
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr style="height: 45px;">
                                            <th class="center">姓名</th>
                                            <th class="center">性别</th>
                                            <th class="center">年龄</th>
                                            <th class="center">电话</th>
                                            <th class="center">学号</th>
                                            <c:if test="${bjid==null }">
	                                            <th class="center">班级</th>
	                                            <th class="center">班主任</th>
                                            </c:if>
                                            <th class="center">学习课程</th>
                                            <th class="center">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody id="b1">
                                    <c:forEach items="${student}" var="c">
                                        <tr>
                                            <td class="center">${c.name }</td>
                                            <td class="center">${c.gender }</td>
                                            <td class="center">${c.age }</td>
                                            <td class="center">${c.number }</td>
                                            <td class="center">${c.sn }</td>
                                            <c:if test="${bjid==null }">
	                                           <td class="center">${c.bj.bjname }</td>
	                                           <td class="center">${c.bj.bjteacher }</td>
                                            </c:if>
                                            <td class="center">${c.teacherone }</td>
                                            <td class="center" style="width: 400px;">
                                            	<form onclick='return xiugai(this);' class="form_form">
                                            		<input type="hidden" name="id" value="${c.id }">
                                            		<input type="hidden" name="page" value="${pageq }">
                                            		<input type="hidden" name="bjid" value="${bjidq }">
                                            		<button type="button"  class="btn btn-info">修改</button>
                                            	</form>
                                            	<form onclick='return selectstudent1(this);' class='form_form'>
                                            		<input type='hidden' name='studentid' value='${c.id }'>
                                            		<input type="hidden" name="page" value="${pageq }">
                                            		<input type="hidden" name="bjid" value="${bjidq }">
                                            		<button class="btn btn-warning" type="button">删除</button>
                                            	</form>
                                            	<form  onclick="return password1(this);" class="form_form">
                                            		<input type="hidden" name="studentid" value="${c.id }">
                                            		<input type="hidden" name="page" value="${pageq }">
                                            		<input type="hidden" name="bjid" value="${bjidq }">
                                            		<button class="btn btn-danger" type="button">重置密码</button>
                                            	</form>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                                &emsp;${xianshi }&emsp;<br>
								    ${sql }
								
							</div>